
const textFormat = (dataSets) => {
  const { source, type, dimensions = undefined } = dataSets;
  let dataValue = '';
  if (type === 'STATIC') {
    dataValue = source[0].value;
  } else {
    dataValue = source && source.length ? source[0][dimensions?.xAxis] : '';
  }
  return {
    formatData: [
      {
        value: dataValue,
      },
    ],
  };
};

export { textFormat };
